add_subdirectory( cholesky )
add_subdirectory( matmul )
add_subdirectory( fibonacci )
add_subdirectory( quicksort )
add_subdirectory( function_min )
find_package( Qt4 )
if( QT4_FOUND )
add_subdirectory( qt-mandelbrot )
endif( QT4_FOUND )
if (NOT(CMAKE_SYSTEM_NAME MATCHES "Windows"))
  find_package ( BZip2 )
  if(BZIP2_FOUND)
    add_subdirectory( pbzip2 )
  else (BZIP2_FOUND)
    message(WARNING "libbz2 not found: Skipping pbzip2 example")
  endif (BZIP2_FOUND)
  if (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "arm"))
    add_subdirectory( swps3 )
  endif (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "arm"))
endif (NOT(CMAKE_SYSTEM_NAME MATCHES "Windows"))
add_subdirectory( nqueens )
find_package ( X11 )
if( X11_FOUND )
add_subdirectory( simple_mandelbrot )
endif( X11_FOUND )
#find_package(Boost NO_MODULE)
#set(Boost_ADDITIONAL_VERSIONS "1.41" "1.51" "1.55.0")
#set(Boost_USE_STATIC_LIBS        ON)
#set(Boost_USE_MULTITHREADED      ON)
#set(Boost_USE_STATIC_RUNTIME    OFF)
#if (CMAKE_SYSTEM_NAME MATCHES "Windows")
#    set(BOOST_ROOT "/local/boost_1_55_0")
#endif (CMAKE_SYSTEM_NAME MATCHES "Windows")
set(Boost_NO_BOOST_CMAKE ON)
# Enable detailed errors
set(Boost_DETAILED_FAILURE_MSG ON)
find_package ( Boost COMPONENTS program_options  )
if(Boost_FOUND)
#MESSAGE(WARNING "Boost 1.41 on Centos with cmake 2.8 is buggy")
#MESSAGE(WARNING "workaroud here: http://stackoverflow.com/questions/9948375/cmake-find-package-succeeds-but-returns-wrong-path")
#if ((CMAKE_SYSTEM_NAME MATCHES "Windows") AND (CMAKE_CL_64))
#    message(WARNING "Cannot check if Boost is 64 bit, skipping examples requiring boost") 
#    message(WARNING "Edit example/CMakeList.txt to force inclusion")
#	add_subdirectory( cwc-simulator )
#  else ((CMAKE_SYSTEM_NAME MATCHES "Windows") AND (CMAKE_CL_64)) 
    add_subdirectory( cwc-simulator )
#  endif ((CMAKE_SYSTEM_NAME MATCHES "Windows") AND (CMAKE_CL_64))
else (Boost_FOUND)
message (WARNING " Boost not found: Skipping CWC simulator example")
endif (Boost_FOUND)

#OpenCV
#include_directories ("/home/software/include") #custom OpenCV headers
#find_library ( OpenCV_LIBS opencv_highgui /home/software/lib ) #custom OpenCV libs
#set (OpenCV_FOUND TRUE)
find_package( OpenCV )
if (OpenCV_FOUND)
  add_subdirectory( denoiser/src )
else (OpenCV_FOUND)
  message (WARNING " OpenCV not found: Skipping denoiser example")
endif (OpenCV_FOUND)

# In principle Bowtie2-ff should works also under Win. Cmake ready, a bit of debugging on code is required. Currently crash. Skipped
IF (UNIX)
add_subdirectory( bowtie2-ff )
ENDIF (UNIX)


